package util;

import java.util.Random;

/**
 * @program: personnel_management_system
 * @description: 通用工具
 * @author: Mr.Sun
 * @create: 2020-06-18 20:24
 **/

public class CommonUtil {
    public static String randStr(int count){
        StringBuilder builder = new StringBuilder();
        String str = "abcdefghijklmnopqrstuvwxyz0123456789";
        Random rnd = new Random();
        for(int i =0; i<count; i++){
            int pos = rnd.nextInt(str.length());
            String s = str.substring(pos,pos+1);//截取字符串的单个字符
            builder.append(s);
        }
        return builder.toString();

    }

    public static String salt (){
        String  str = new String();
        str = randStr(32);
        return str;
    }

}
